<link type="text/css" href="{_COMMON_URL_}Style/Css/base.css" rel="stylesheet" />
<link type="text/css" href="{_PUBLIC_URL_}Css/page.css" rel="stylesheet" />
<script type="text/javascript" src="{_COMMON_URL_}Style/Js/jquery-1.7.1.min.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="{_COMMON_URL_}Style/Js/ie6pngfix.min.js"></script>
<![endif]-->
<script type="text/javascript" language="javascript">
//窗口尺寸调整
$(window).resize(function(){ resize();});
$(document).ready(function(){ resize();});
function resize()
{
  if ($(window).width() <= 1000) {
    $("#mainBody").css("width","1000px");
  } else {
    $("#mainBody").css("width","auto");
  }
  if ($(window).height() <= 475) {
    $("#mainBody").css("height","475px");
  } else {
    $("#mainBody").css("height","auto");
  }
}

/* 鼠标经过时数据行变色 */
$(document).ready(function(){
  $(".rowPoint tbody tr").mouseenter(function(){
    $(this).addClass("hover");
  });
  $(".rowPoint tbody tr").mouseleave(function(){
    $(this).removeClass("hover");
  });
})

/* 反选 */
function getChoose($obj, $selector) {
  if ($($obj).attr("checked") === "checked") {
    $($selector).attr("checked", "checked");
  } else {
    $($selector).removeAttr("checked");
  }
}

/* 鼠标滑过鼠标变色 */
$(document).ready(function(){
  $(".note").mouseenter(function(){
    $(this).addClass("noteHover");
  });
  $(".note").mouseleave(function(){
    $(this).removeClass("noteHover");
  });
});

/* 按钮点击提交到指定页面 */
function btnSubmit(form, url) {
  $(form).attr('action', url).submit();
}

//响应回车事件
$(function() {
  $(window).bind('keydown', function(e) {
    if (e.keyCode == 13) {
      $('#enterResponse').trigger('click');
    }
  });
  $('textarea').live('keydown', function(e) {
    if (e.ctrlKey && e.keyCode == 13) {
      $('#enterResponse').trigger('click');
    } else {
      e.stopPropagation();
    }
  });
});
</script>
<link type="text/css" href="{_COMMON_URL_}Util/Kindeditor/themes/default/default.css" rel="stylesheet" />
<script type="text/javascript" src="{_COMMON_URL_}Util/Kindeditor/kindeditor.js"></script>
<script type="text/javascript" src="{_COMMON_URL_}Util/Kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript">
//Kindeditor编辑器导入 4.1.10
function getEditor(selecter) {
  KindEditor.ready(function(K) {
    var editor;
    editor = K.create('textarea'+selecter, {
      items : [
        'source', '|', 'undo', 'redo', '|', 'cut', 'copy', 'paste',
        'plainpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
        'clearhtml', 'selectall', '|', 'baidumap', 'link', 'unlink', 'about', '/',
        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', '|', 'bold',
        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','image', 'insertfile', 'table', 'hr'
      ],
      afterCreate : function() {
        var self = this;
        K.ctrl(this.edit.iframe.get(0).contentWindow.document, 13, function() {
          self.sync();
          $('#enterResponse').trigger('click');
        });
      },
      afterBlur : function() {
        this.sync();
      },
      minWidth : 650,
      minHeight : 200,
      allowFileManager : false
    });
  });
}

//Kindeditor图片上传导入 4.1.10
function getImage(textSelecter, btnSelecter) {
  KindEditor.ready(function(K) {
    var editor = K.editor({
      allowFileManager : false
    });
    K(btnSelecter).click(function() {
      editor.loadPlugin('image', function() {
        editor.plugin.imageDialog({
          showRemote : false,
          imageUrl : K(textSelecter).val(),
          clickFn : function(url, title, width, height, border, align) {
            K(textSelecter).val(url);
            editor.hideDialog();
          }
        });
      });
    });
  });
}
</script>
<link type="text/css" href="{_COMMON_URL_}Util/JqueryUI/themes/base/jquery-ui.min.css" rel="stylesheet" />
<script type="text/javascript" src="{_COMMON_URL_}Util/JqueryUI/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="{_COMMON_URL_}Util/JqueryUI/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="{_COMMON_URL_}Util/JqueryUI/ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="{_COMMON_URL_}Util/JqueryUI/ui/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript">
//开始时间选择器
//用于选择开始的时间段，会与结束时间选择器相互影响
function dpStart(selector, endSelector) {
  $(selector).datepicker({
    changeMonth : true,
    changeYear : true,
    minDate : 0,
    onSelect : function(dateText) {
      $(endSelector).attr('init', true)
      dpEnd(endSelector, selector);
      $(endSelector).datepicker('option', 'minDate', dateText);
    }
  });
  if (!$(selector).attr('init')) {
    $(selector).attr('init', true).trigger('focus');
  }
}

//结束时间选择器
//用于选择结束的时间段，会与结束时间选择器相互影响
function dpEnd(selector, startSelector) {
  $(selector).datepicker({
    changeMonth : true,
    changeYear : true,
    minDate : 0,
    onSelect : function(dateText) {
      $(startSelector).attr('init', true)
      dpStart(startSelector, selector);
      $(startSelector).datepicker('option', 'maxDate', dateText);
    }
  });
  if (!$(selector).attr('init')) {
    $(selector).attr('init', true).trigger('focus');
  }
}
</script>